/*
 * $Id$
 */

package corejs.stmt;

import corejs.expr.Expression;
import corejs.expr.ExpressionVisitor;

/**
 *
 * @author pengyu
 */
public class DoWhile extends Loop {
   
   public DoWhile(final Expression test, final Statement stmt) {
      super(test, stmt);
   }

   /**
    * 
    * @param v
    * @return 
    */
   @Override
   protected boolean test(final ExpressionVisitor v) {
      return true;
   }

   /**
    * 
    * @param v
    * @return 
    */
   protected boolean afterEachIteration(final ExpressionVisitor v) {
      return _test.accept(v).toBool().isTrue() ? false : true;
   }
}
